1. Technical Field
The present invention relates in general to the field of computer programming and in particular to compilers. Still more particularly, the present invention relates to an improved method and system for detecting incorrect alias assumptions.
2. Description of the Related Art
Compilers are computer programs that translate text, which is provided by a computer programmer in a source language (also referred to as source code), into a different program language (also referred to as the target language or object code). Compilers thus enable computer programmers to turn a program written in a high level language into an executable low level program capable of being understood by a computer processor.
Conventional compilers perform multiple operations and are capable of supporting various user-defined options in order to optimize the performance of computer program code. One option typically utilized by computer programmers is to assert that no aliases exist for certain variables within the computer program. An alias refers to a variable that when changed, has an indirect and/or unexpected effect on another variable. Aliases typically exist when a programmer utilizes multiple names for the same data location within system memory. Utilizing a compiler option to assert to the compiler that no aliases exist allows the compiler to apply more aggressive code optimization algorithms during the compiling process. However, if any aliases do exist within a program and the programmer has asserted to the compiler that aliases do not exist, then incorrect behavior (e.g. runtime errors) can occur when the compiled program is executed.